home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
Updates
/
HD-Installer
/
jst_dev
/
sources
/
src
/
loaders
/
Prince
/
princeread.asm
< prev
next >
Wrap
Assembly Source File
|
2000-04-12
|
14KB
|
590 lines
; IRA V1.02 (Sep 6 1993) (c)1993 Tim Ruehsen
; re-source of Prince Of Persia read routine
include "/disklib_hard/trackmoves.i"
CIAB_PRA EQU $BFD000
CIAB_PRB EQU $BFD100
CIAB_DDRA EQU $BFD200
CIAB_DDRB EQU $BFD300
CIAB_ICR EQU $BFDD00
CIAA_PRA EQU $BFE001
CIAA_DDRA EQU $BFE201
CIAA_DDRB EQU $BFE301
CIAA_TALO EQU $BFE401
CIAA_TAHI EQU $BFE501
CIAA_ICR EQU $BFED01
CIAA_CRA EQU $BFEE01
INTREQR EQU $DFF01E
DSKPTH EQU $DFF020
DSKLEN EQU $DFF024
DSKSYNC EQU $DFF07E
DMACON EQU $DFF096
INTREQ EQU $DFF09C
ADKCON EQU $DFF09E
include "/lib/libs.i"
XDEF _ReadPOPSectors
XREF _SysBase
RAW_LEN = $3100
_ReadPOPSectors:
move.l 4(a7),A1 ; buffer
move.l 8(a7),D0 ; offset
move.l 12(a7),D1 ; lenght
movem.l D1-A6,-(sp)
bsr @ReadPOPSectors
movem.l (sp)+,D1-A6
rts
@ReadPOPSectors:
movem.l D1-A6,-(sp)
move.l A1,buffer
move.l D0,offset
move.l D1,length
move.l _SysBase,A6
move.l #RAW_LEN,D0
move.l #MEMF_CHIP,D1
JSRLIB AllocMem
move.l D0,rawbuffer
beq error$
move.l _SysBase,A6
JSRLIB Disable
move.l _SysBase,A6
JSRLIB SuperState
move.l D0,userstack
move.w #$2700,SR
moveq.l #0,D0
jsr _InitDisk
jsr _WaitDiskReady
bsr initread
move.l buffer,A1
move.l rawbuffer,A0
move.l offset,D0
move.l length,D1
nop
nop
bsr doread
bmi ok$
st.b errorflag
ok$
nop
nop
jsr _EndDisk
move.w #$2000,SR
move.l userstack,D0
move.l _SysBase,A6
JSRLIB UserState
move.l _SysBase,A6
JSRLIB Enable
move.l _SysBase,A6
move.l rawbuffer,A1
move.l #RAW_LEN,D0
JSRLIB FreeMem
exit$
moveq.l #0,D0
move.b errorflag,D0
movem.l (sp)+,D1-A6
rts
error$
moveq #-1,D7
bra exit$
LAB_0006:
MOVEM.L D0-D2,-(A7) ;0B6: 48E7E000
LAB_0007:
BTST #0,CIAA_CRA ;0BA: 0839000000BFEE01
BNE.S LAB_0007 ;0C2: 66F6
LAB_0008:
TST D0 ;0C4: 4A40
BEQ LAB_000C ;0C6: 67000038
CMPI #$005A,D0 ;0CA: 0C40005A
BHI.S LAB_0009 ;0CE: 6204
MOVE D0,D1 ;0D0: 3200
BRA.S LAB_000A ;0D2: 6004
LAB_0009:
MOVE #$005A,D1 ;0D4: 323C005A
LAB_000A:
SUB D1,D0 ;0D8: 9041
MULU #$02CC,D1 ;0DA: C2FC02CC
MOVE SR,D2 ;0DE: 40C2
ORI #$0700,SR ;0E0: 007C0700
MOVE.B D1,CIAA_TALO ;0E4: 13C100BFE401
LSR #8,D1 ;0EA: E049
MOVE.B D1,CIAA_TAHI ;0EC: 13C100BFE501
MOVE D2,SR ;0F2: 46C2
LAB_000B:
BTST #0,CIAA_CRA ;0F4: 0839000000BFEE01
BNE.S LAB_000B ;0FC: 66F6
BRA.S LAB_0008 ;0FE: 60C4
LAB_000C:
MOVEM.L (A7)+,D0-D2 ;100: 4CDF0007
RTS ;104: 4E75
MOVEM.L D0/D2,-(A7) ;106: 48E7A000
LAB_000D:
BTST #0,CIAA_CRA ;10A: 0839000000BFEE01
BNE.S LAB_000D ;112: 66F6
MULU #$B746,D0 ;114: C0FCB746
ADDI.L #$00008000,D0 ;118: 068000008000
SWAP D0 ;11E: 4840
TST D0 ;120: 4A40
BEQ LAB_000F ;122: 67000022
MOVE SR,D1 ;126: 40C1
ORI #$0700,SR ;128: 007C0700
MOVE.B D0,CIAA_TALO ;12C: 13C000BFE401
LSR #8,D0 ;132: E048
MOVE.B D0,CIAA_TAHI ;134: 13C000BFE501
MOVE D1,SR ;13A: 46C1
LAB_000E:
BTST #0,CIAA_CRA ;13C: 0839000000BFEE01
BNE.S LAB_000E ;144: 66F6
LAB_000F:
MOVEM.L (A7)+,D0/D2 ;146: 4CDF0005
RTS ;14A: 4E75
initread:
MOVEM.L D0-D1,-(A7) ;14C: 48E7C000
MOVE #$7F00,ADKCON ;150: 33FC7F0000DFF09E
MOVE #$9100,ADKCON ;158: 33FC910000DFF09E
MOVE.B #$FF,CIAB_PRB ;160: 13FC00FF00BFD100
MOVE.B #$8F,CIAB_PRB ;168: 13FC008F00BFD100
MOVE.B #$FF,CIAB_PRB ;170: 13FC00FF00BFD100
MOVE.B #$F7,CIAB_PRB ;178: 13FC00F700BFD100
BSR LAB_0031 ;180: 610002DC
BTST #2,CIAA_PRA ;184: 0839000200BFE001
NOP ;18C: 4E71
MOVE.B #$7F,CIAB_PRB ;18E: 13FC007F00BFD100
MOVE.B #$77,CIAB_PRB ;196: 13FC007700BFD100
MOVE #$00FA,D0 ;19E: 303C00FA
MOVE #$0010,D1 ;1A2: 323C0010
LAB_0010:
BSR LAB_0006 ;1A6: 6100FF0E
BTST #5,CIAA_PRA ;1AA: 0839000500BFE001
BEQ.S LAB_0011 ;1B2: 6706
SUBQ #1,D1 ;1B4: 5341
BNE.S LAB_0010 ;1B6: 66EE
NOP ;1B8: 4E71
LAB_0011:
BSR LAB_0028 ;1BA: 61000230
ORI.B #$08,CCR ;1BE: 003C0008
BRA.S LAB_0012 ;1C2: 6004
ANDI.B #$F7,CCR ;1C4: 023C00F7
LAB_0012:
MOVEM.L (A7)+,D0-D1 ;1C8: 4CDF0003
RTS ;1CC: 4E75
MOVE.B #$FF,CIAB_PRB ;1CE: 13FC00FF00BFD100
MOVE.B #$87,CIAB_PRB ;1D6: 13FC008700BFD100
MOVE.B #$FF,CIAB_PRB ;1DE: 13FC00FF00BFD100
RTS ;1E6: 4E75
MOVE.B #$FF,CIAB_PRB ;1E8: 13FC00FF00BFD100
MOVE.B #$F7,CIAB_PRB ;1F0: 13FC00F700BFD100
BSR LAB_0031 ;1F8: 61000264
LAB_0013:
BTST #2,CIAA_PRA ;1FC: 0839000200BFE001
BNE.S LAB_0013 ;204: 66F6
MOVE.B #$FF,CIAB_PRB ;206: 13FC00FF00BFD100
RTS ;20E: 4E75
LAB_0014:
MOVEM.L A1,-(A7) ;210: 48E70040
MOVEA.L #$00000000,A1 ;214: 227C00000000
BSR LAB_0019 ;21A: 61000030
MOVEM.L (A7)+,A1 ;21E: 4CDF0200
RTS
doread:
MOVEM.L D0-D1/A1,-(A7) ;224: 48E7C040
LAB_0015:
BSR LAB_0019 ;228: 61000022
BPL.S LAB_0017 ;22C: 6A14
SUBQ #1,D1 ;22E: 5341
BEQ.S LAB_0016 ;230: 670A
ADDQ #1,D0 ;232: 5240
ADDA.L #$00001800,A1 ;234: D3FC00001800
BRA.S LAB_0015 ;23A: 60EC
LAB_0016:
ORI.B #$08,CCR ;23C: 003C0008
BRA.S LAB_0018 ;240: 6004
LAB_0017:
ANDI.B #$F7,CCR ;242: 023C00F7
LAB_0018:
MOVEM.L (A7)+,D0-D1/A1 ;246: 4CDF0203
RTS ;24A: 4E75
LAB_0019:
MOVEM.L D0-D4/A0-A3,-(A7) ;24C: 48E7F8F0
MOVEA.L A0,A2 ;250: 2448
MOVEA.L A1,A3 ;252: 2649
BTST #5,CIAA_PRA ;254: 0839000500BFE001
NOP ;25C: 4E71
NOP ;25E: 4E71
BTST #2,CIAA_PRA ;260: 0839000200BFE001
NOP ;268: 4E71
NOP ;26A: 4E71
BSR ReadRawTrack ;26C: 610001A8
MOVE #$0004,D4 ;270: 383C0004
LAB_001A:
SUBQ #1,D4 ;274: 5344
BMI.S LAB_001C ;276: 6B6E
MOVE #$3020,D0 ;278: 303C3020
MOVE #$4891,D1 ;27C: 323C4891
MOVEA.L A2,A0 ;280: 204A
BSR LAB_0035 ;282: 61000256
CMPI #$4891,(A2) ;286: 0C524891
BNE.S LAB_001A ;28A: 66E8
CMPI #$44A9,2(A2) ;28C: 0C6A44A90002
BNE.S LAB_001A ;292: 66E0
MOVE #$0008,D0 ;294: 303C0008
LEA 4(A2),A0 ;298: 41EA0004
MOVEA.L A0,A1 ;29C: 2248
BSR DecodeBytes ;29E: 61000378
MOVE #$3008,D0 ;2A2: 303C3008
LEA 12(A2),A0 ;2A6: 41EA000C
BSR LAB_003F ;2AA: 610003B6
CMP.L 4(A2),D0 ;2AE: B0AA0004
BNE.S LAB_001A ;2B2: 66C0
MOVE #$0008,D0 ;2B4: 303C0008
LEA 12(A2),A0 ;2B8: 41EA000C
MOVEA.L A0,A1 ;2BC: 2248
BSR DecodeBytes ;2BE: 61000358
MOVE.L (A0),D0 ;2C2: 2010
CMP LAB_0005(PC),D0 ;2C4: B07AFDEE
BNE.S LAB_001C ;2C8: 661C
MOVE #$3000,D0 ;2CA: 303C3000
LEA 20(A2),A0 ;2CE: 41EA0014
MOVEA.L A3,A1 ;2D2: 224B
CMPA.L #$00000000,A1 ;2D4: B3FC00000000
BEQ.S LAB_001B ;2DA: 6704
BSR DecodeBytes ;2DC: 6100033A
LAB_001B:
ORI.B #$08,CCR ;2E0: 003C0008
BRA.S LAB_001D ;2E4: 6004
LAB_001C:
ANDI.B #$F7,CCR ;2E6: 023C00F7
LAB_001D:
MOVEM.L (A7)+,D0-D4/A0-A3 ;2EA: 4CDF0F1F
RTS ;2EE: 4E75
MOVEM.L D0-D1/A1,-(A7) ;2F0: 48E7C040
LAB_001E:
BSR LAB_0022 ;2F4: 61000022
BPL.S LAB_0020 ;2F8: 6A14
SUBQ #1,D1 ;2FA: 5341
BEQ.S LAB_001F ;2FC: 670A
ADDQ #1,D0 ;2FE: 5240
ADDA.L #$00001800,A1 ;300: D3FC00001800
BRA.S LAB_001E ;306: 60EC
LAB_001F:
ORI.B #$08,CCR ;308: 003C0008
BRA.S LAB_0021 ;30C: 6004
LAB_0020:
ANDI.B #$F7,CCR ;30E: 023C00F7
LAB_0021:
MOVEM.L (A7)+,D0-D1/A1 ;312: 4CDF0203
RTS ;316: 4E75
LAB_0022:
MOVEM.L D0-D1,-(A7) ;318: 48E7C000
BTST #5,CIAA_PRA ;31C: 0839000500BFE001
NOP ;324: 4E71
BTST #2,CIAA_PRA ;326: 0839000200BFE001
NOP ;32E: 4E71
BTST #3,CIAA_PRA ;330: 0839000300BFE001
BEQ.S LAB_0024 ;338: 6728
BSR ReadRawTrack ;33A: 610000DA
MOVE #$0004,D1 ;33E: 323C0004
LAB_0023:
SUBQ #1,D1 ;342: 5341
BMI.S LAB_0024 ;344: 6B1C
BSR LAB_0026 ;346: 61000024
MOVE #$3300,D0 ;34A: 303C3300
BSR LAB_0037 ;34E: 610001FE
MOVE LAB_0005(PC),D0 ;352: 303AFD60
BSR LAB_0014 ;356: 6100FEB8
BPL.S LAB_0023 ;35A: 6AE6
ORI.B #$08,CCR ;35C: 003C0008
BRA.S LAB_0025 ;360: 6004
LAB_0024:
ANDI.B #$F7,CCR ;362: 023C00F7
LAB_0025:
MOVEM.L (A7)+,D0-D1 ;366: 4CDF0003
RTS ;36A: 4E75
LAB_0026:
MOVEM.L D0-D1/A0-A3,-(A7) ;36C: 48E7C0F0
MOVEA.L A1,A3 ;370: 2649
MOVE #$AAAA,D0 ;372: 303CAAAA
MOVE #$0173,D1 ;376: 323C0173
LAB_0027:
MOVE D0,(A0)+ ;37A: 30C0
DBF D1,LAB_0027 ;37C: 51C9FFFC
MOVE.L #$48914891,(A0)+ ;380: 20FC48914891
MOVE #$44A9,(A0)+ ;386: 30FC44A9
MOVEA.L A0,A2 ;38A: 2448
MOVE.L #$00000000,(A0)+ ;38C: 20FC00000000
MOVE.L #$00000000,(A0)+ ;392: 20FC00000000
MOVE #$0000,(A0) ;398: 30BC0000
MOVE LAB_0005(PC),2(A0) ;39C: 317AFD160002
MOVE #$0004,D0 ;3A2: 303C0004
MOVEA.L A0,A1